package com.rw.bootdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * @author rabit
 */
@Controller
public class ViewController {

    @RequestMapping("h1")
    public String getJsp(Model model){
//        int i =  1/0;
        System.out.println("ViewController.getJsp");
        model.addAttribute("userName","张三1234");
        List<String> list = new ArrayList<>();
        list.add("123");
        list.add("1234");
        list.add("张三");
        list.add("李四");
        model.addAttribute("data",list);
        model.addAttribute("url","http://www.baidu.com");
        return "test";
    }
}
